#coding=utf-8
import sys,os,redis,json,logging,ConfigParser,time,paramiko

def sshExecute(host, port, username, password, cmd):
    c = "pidof java"
    ssh = paramiko.SSHClient()
    ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
    ssh.connect(host, port, username, password)
    stdin, stdout, stderr = ssh.exec_command(c)

    for line in stdout:
        print line.strip('\n')
    ssh.close()

